package com.ilovepostcard.view;

import android.app.Activity;
import android.content.Context;
import android.util.AttributeSet;

public class PostcardBackButton extends PostcardMenuItem {

    public PostcardBackButton(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
        setupView();
    }

    public PostcardBackButton(Context context, AttributeSet attrs) {
        super(context, attrs);
        setupView();
    }

    public PostcardBackButton(Context context) {
        super(context);
        setupView();
    }

    private void setupView() {
        this.setOnMenuClickListener(new OnMenuClickListener() {
            
            @Override
            public void onClickMenu() {
                ((Activity)getContext()).finish();
            }
        });
    }
}
